﻿@model CommentEditModel
@{
    var tenantTypeId = ViewData.Get<string>("tenantTypeId", string.Empty);
    var parentId = ViewData.Get<long>("parentId", 0);
    var commentedObjectId = ViewData.Get<long>("commentedObjectId", 0);
}
@if (UserContext.CurrentUser != null)
{
    using (Html.BeginForm("CreateComment", "Portal", FormMethod.Post, new { @id = "createComment-" + parentId, @class = "CommentControl form-horizontal tn-form-validation" }))
    {
    @Html.AntiForgeryToken()
        <div class="tn-reply-form">
            @Html.Hidden("parentId", parentId)
            @Html.Hidden("commentedObjectId", commentedObjectId)
            @Html.Hidden("tenantTypeId", tenantTypeId)
            <textarea name="Body" class="form-control" rows="3" placeholder="添加评论" id="textareaBody"></textarea>
            <div class="btn-toolbar" role="toolbar">
                <div class="btn-group btn-group-sm pull-left" role="group">
                    <a class="btn btn-default emotion" href="javascript:;" role="button"><i class="fa fa-smile-o"></i></a>
                </div>
                <button class="btn btn-primary btn-sm tn-btn-wp pull-right commentsubmit" data-id="@parentId" type="button">评论</button>
            </div>
        </div>
    }
    <script type="text/javascript">
        require(['jquery', 'qqFace'], function ($) {
            $('.emotion').qqFace({
                id: 'facebox',
                assign: 'textareaBody',
                ohref: '/common/GetEmotions',
                directoryname: 'default',
            });
        })
    </script>
    <style>
        #facebox {
            background-color: #fff;
        }
    </style>
}
